package com.wantong.jianpu.net;



import com.wantong.jianpu.base.BaseResultBean;
import com.wantong.jianpu.beans.ConfirmTourBean;
import com.wantong.jianpu.beans.DeviceBean;
import com.wantong.jianpu.beans.DeviceListBean;
import com.wantong.jianpu.beans.DictBean;
import com.wantong.jianpu.beans.FaultDetailBean;
import com.wantong.jianpu.beans.FaultListBean;
import com.wantong.jianpu.beans.InspectionDetailBean;
import com.wantong.jianpu.beans.LocationBean;
import com.wantong.jianpu.beans.LoginBean;
import com.wantong.jianpu.beans.MeasuresSelectBean;
import com.wantong.jianpu.beans.MessageBean;
import com.wantong.jianpu.beans.PersonBean;
import com.wantong.jianpu.beans.RankBean;
import com.wantong.jianpu.beans.StatusBean;
import com.wantong.jianpu.beans.UpLoadBean;
import com.wantong.jianpu.beans.UserBean;


import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;
import retrofit2.http.Streaming;

/**
 * @author PACY
 * 创建时间 19/1/9 14:29.
 * 邮箱 pengwwe457621023@qq.com
 * 类描述 接口地址
 */
public interface ApiService {

    /**
     * 登录
     */
    @POST("auth/applogin")
    Observable<BaseResultBean<LoginBean>> login(@Body RequestBody body);


    /**
     * 维修等级下拉列表
     */
    @GET("jp/maintainlevel/listAll")
    Observable<BaseResultBean<List<RankBean>>> rankList();

    /**
     * 维修人员下拉列表
     */
    @GET("system/user/getUserListByRoleName/repair_user")
    Observable<BaseResultBean<List<PersonBean>>> userList();

    /**
     * 维修状态下拉列表
     */
    @GET("system/dict/data/type/repair_status")
    Observable<BaseResultBean<List<StatusBean>>> statusList();


    /**
     * 故障维修列表
     */
    @GET("jp/repair_order/appList")
    Observable<BaseResultBean<FaultListBean>> faultList(@QueryMap Map<String,Object> map);


    /**
     * 查询位置树
     */
    @GET("jp/location/treelistAll")
    Observable<BaseResultBean<List<LocationBean>>> locationTree();

    /**
     * 查询巡检区域
     */
    @GET("jp/location/getInspectionLocation")
    Observable<BaseResultBean<List<LocationBean>>> getInspectionLocation();


    /**
     * 通过位置查询设备列表
     */
    @GET("jp/equ/getEquListByLocation")
    Observable<BaseResultBean<List<DeviceBean>>> getEquListByLocation(@Query("locationId") int locationId);

    /**
     * 图片上传
     */
    @Multipart
    @POST("file/upload")
    Observable<BaseResultBean<UpLoadBean>> upLoadFile(@Part List<MultipartBody.Part> params);

    /**
     * 批量文件上传
     */
    @Streaming
    @POST("file/upload_files")
    Observable<BaseResultBean<List<UpLoadBean>>> upLoadFiles(@Body RequestBody Body);

    /**
     * 故障上报
     */
    @POST("jp/repair_order")
    Observable<BaseResultBean> commitRepair(@Body RequestBody body);


    /**
     * 故障上报
     */
    @PUT("jp/repair_order")
    Observable<BaseResultBean> changeRepair(@Body RequestBody body);

    /**
     * 查询报修详情
     */
    @GET("jp/repair_order/getAppInfo/{id}")
    Observable<BaseResultBean<FaultDetailBean>> getRepairDetail(@Path("id") String id);

    /**
     * 查询报修详情状态
     */
    @GET("jp/repair_order/getButtonName")
    Observable<BaseResultBean<Integer>> getRepairDetailStatus(@Query("orderId") String id);

    /**
     * 设备巡检列表
     */
    @GET("jp/inspection/appList")
    Observable<BaseResultBean<DeviceListBean>> getDeviceList(@QueryMap Map<String,Object> map);

    /**
     * 查询设备巡检详情
     */
    @GET("jp/inspection/getAppInfo")
    Observable<BaseResultBean<InspectionDetailBean>> getDeviceDetail(@Query("id") String id);


    /**
     * 指派维修人员
     */
    @POST("jp/repair_order/dispatch")
    Observable<BaseResultBean> dispatch(@Body RequestBody body);


    /**
     * 故障分析下拉
     */
    @GET("jp/measures/listAll")
    Observable<BaseResultBean<List<MeasuresSelectBean>>> listAll();

    /**
     * 维修提交
     */
    @POST("jp/repair_order/repair")
    Observable<BaseResultBean> commitRepairProgress(@Body RequestBody body);


    /**
     * 修复确认
     */
    @POST("jp/repair_order/repairConfirm")
    Observable<BaseResultBean> repairConfirm(@Body RequestBody body);


    /**
     * 工单确认提交
     */
    @POST("jp/repair_order/order_submit")
    Observable<BaseResultBean> order_submit(@Body RequestBody body);

    /**
     * 工单退回
     */
    @POST("jp/repair_order/gdth")
    Observable<BaseResultBean> gdth(@Body RequestBody body);

    /**
     * 保养范围
     */
    @GET("system/dict/data/type/maintain_scope")
    Observable<BaseResultBean<List<DictBean>>> scope();

    /**
     * 巡检
     */
    @POST("jp/inspection_record")
    Observable<BaseResultBean> inspection_record(@Body RequestBody body);


    /**
     * 获取用户个人信息
     */
    @GET("system/user/profile")
    Observable<BaseResultBean<UserBean>> getUserInfo();

    /**
     * 巡检确认
     */
    @POST("jp/inspection_record/inspection_confirm")
    Observable<BaseResultBean> inspection_confirm(@Body RequestBody body);

    /**
     * 完成本次巡检
     */
    @POST("jp/inspection/completeInspection/{id}")
    Observable<BaseResultBean> completeInspection(@Path("id") String id);

    /**
     * 修改密码
     */
    @PUT("system/user/resetPwd")
    Observable<BaseResultBean> resetPwd(@Body RequestBody body);

    /**
     * 获取巡检确认列表
     */
    @GET("jp/inspection_record/applist")
    Observable<BaseResultBean<ConfirmTourBean>> recordList(@QueryMap Map<String,Object> map);

    /**
     *
     */
    @GET("jp/message/listAll")
    Observable<BaseResultBean<MessageBean>> messageList(@QueryMap Map<String,Object> map);

    /**
     * 设置消息已读
     */
    @POST("jp/message/receive")
    Observable<BaseResultBean> receive(@Body RequestBody body);

    /**
     * 获取未读消息
     */
    @GET("jp/message/getNotReceiveCount")
    Observable<BaseResultBean<Integer>> getMessage();

}
